import type { AmbientLight } from "three";
import GUI from "three/examples/jsm/libs/lil-gui.module.min.js"

export class GuiApplication {
  private static _instance: GuiApplication

  private _gui: GUI | undefined;

  public get gui(): GUI {
    if (!this._gui) {
      this._gui = new GUI()
    }

    return this._gui
  }
  constructor() {
  }

  public static getInstance(): GuiApplication {
    if (!this._instance) {
      this._instance = new GuiApplication()
    }
    return this._instance
  }

  public debugLight(ambientLight: AmbientLight) {
    const lightFolder = this.gui.addFolder('光');
    lightFolder.add(ambientLight, 'visible')
    lightFolder.add(ambientLight, 'intensity', 0, 10);
  }
}